<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
   <div id="vue">
       <p v-color="colors">2112312313</p>
   </div>
</body>
<script>
    var vue = new Vue({
        el:"#vue",
        data:{
            colors:"yellow"
        },
        //自定义局部指令
        directives:{
            color:function (el,valObj) {
                var colorName = valObj.value; //获取颜色名称
                el.style.color = colorName;
            }
        }
    });
</script>
</html>